package eu.vranckaert.workRegistrationWidget.domain;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @Author Dirk Vranckaert
 * Date: 23-apr-2010
 * Time: 19:11:53
 */
public class TimeRegistration implements Serializable {
    private int id;
    private Date startDate;
    private Date endDate;

    private Double startLongtitude;
    private Double startLatitude;
    private Double endLongtitude;
    private Double endLatitude;

    private List<TimeRegistration> expandableList = new ArrayList<TimeRegistration>();

    /* Transient fields */
    private boolean startAction;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public boolean isStartAction() {
        return startAction;
    }

    public void setStartAction(boolean startAction) {
        this.startAction = startAction;
    }

    public Double getStartLongtitude() {
        return startLongtitude;
    }

    public void setStartLongtitude(Double startLongtitude) {
        this.startLongtitude = startLongtitude;
    }

    public Double getStartLatitude() {
        return startLatitude;
    }

    public void setStartLatitude(Double startLatitude) {
        this.startLatitude = startLatitude;
    }

    public Double getEndLongtitude() {
        return endLongtitude;
    }

    public void setEndLongtitude(Double stopLongtitude) {
        this.endLongtitude = stopLongtitude;
    }

    public Double getEndLatitude() {
        return endLatitude;
    }

    public void setEndLatitude(Double endLatitude) {
        this.endLatitude = endLatitude;
    }

    public void addTimeRegistrationToExpandableList(TimeRegistration timeRegistration) {
        if(expandableList == null) {
            this.expandableList = new ArrayList<TimeRegistration>();
        }
        this.expandableList.add(timeRegistration);
    }

    public void clearExpandableList() {
        this.expandableList = null;
    }

    public List<TimeRegistration> getExpandableList() {
        return expandableList;
    }
}
